import { request } from './requests'

// 获取商品分类列表数据
export function getCategoriesList(queryInfo = {}) {
    return request({
        url: 'categories',
        params: queryInfo
    })
}

// 添加商品分类
export function addCategoriesList(addCategoryForm) {
    return request({
        url: 'categories',
        method: 'post',
        data: addCategoryForm
    })
}

// 修改商品分类
export function editCategoriesList(id, cat_name) {
    return request({
        url: 'categories/' + id,
        method: 'put',
        data: cat_name
    })
}

// 删除商品分类
export function deleteCategoriesList(id) {
    return request({
        url: 'categories/' + id,
        method: 'delete'
    })
}